qrisp.sbp_mult#

sbp_mult(factor_1_qf, factor_2_qf, output_qf=None)[source]#

Performs multiplication based on the evaluation of semi-boolean polynomials.

Parameters:
factor_1_qfQuantumFloat

The first factor to multiply.

factor_2_qfQuantumFloat

The second factor to multiply.

output_qfQuantumFloat, optional

The QuantumFloat to store the result in. By default, a suited new QuantumFloat is created.

Returns:
output_qfQuantumFloat

A QuantumFloat containing the result of the multiplication.

Examples

We multiply two QuantumFloats:

from qrisp import QuantumFloat, sbp_mult
qf_0 = QuantumFloat(3)
qf_1 = QuantumFloat(3)
qf_0[:] = 3
qf_1[:] = 4
qf_res = sbp_mult(qf_0, qf_1)
print(qf_res)
#Yields: {12: 1.0}